package com.zhangzhibo.service.bill;

import com.zhangzhibo.dao.bill.BillMapper;
import com.zhangzhibo.pojo.Bill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;

@Service
public class BillServiceImpl implements BillService{
    @Autowired
    @Qualifier("billMapper")
    private BillMapper billMapper;

    @Override
    public int getBillCount(String queryProductName, int queryProviderId, int queryIsPayment){
        return billMapper.getBillCount(queryProductName,queryProviderId,queryIsPayment);
    }

    @Override
    public List<Bill> getBillList(String queryProductName, int queryProviderId, int queryIsPayment, int currentPageNo, int pageSize){
        return billMapper.getBillList(queryProductName,queryProviderId,queryIsPayment,currentPageNo,pageSize);
    }

    @Override
    public int addBill(Bill bill){
        return billMapper.addBill(bill);
    }

    @Override
    public int checkBillCodeNumber() {
        return billMapper.checkBillCodeNumber();
    }

    @Override
    public int deleteBill(int billId){
        return billMapper.deleteBill(billId);
    }

    @Override
    public Bill findByBillId(int billId){
        return billMapper.findByBillId(billId);
    }

    @Override
    public int modifyBill(Bill bill){
        return billMapper.modifyBill(bill);
    }
}
